home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / util / libs / Tran43pch.lha / _Patch43 / install < prev    next >
Encoding:
Text File  |  1997-07-03  |  6.4 KB  |  209 lines

  1. (set @app-name "Translator43.1")
  2. (set @default-dest (pathonly @icon))
  3. (set targetdir "LIBS:")
  4. (set target (tackon targetdir "translator.library"))
  5. (set newtarget1 (tackon targetdir "translator42.4xlibrary"))
  6. (set newtarget2 (tackon targetdir "translator43.0xlibrary"))
  7. (set accentdir "Locale:accents/")
  8. (set acctarg (tackon accentdir "Italiano.accent"))
  9. (set newacctarg (tackon accentdir "Italiano42.Xaccent"))
  10. (set path (pathonly @icon))
  11. (set spatch ("\"%s\"" (tackon path "spatch")))
  12. (set vernum (getversion target))
  13. (set ver (/ vernum 65536))
  14. (set rev (- vernum (* ver 65536)))
  15. (
  16. if (AND (= ver 43) (= rev 0))
  17.   (
  18.     (
  19. message (cat ("  Welcome to the Translator43.1 Update Patch")
  20.              ("\n\nThis Patch can only be applied to existing.")
  21.              ("\ninstalled versions of Translator43.0 and")
  22.              ("\nTranslator42.4 in your LIBS: directory.\n")
  23.              ("\nYou appear to have Translator43.0 installed.\n")
  24.              ("\nThis file will be renamed as Translator43.0xlibrary")
  25.              ("\nand used to patch in the new translator.library.")
  26.              ("\n\nAre you ready to proceed?")
  27.         )
  28.     )
  29.   )
  30.   (
  31.     (
  32. message (cat (" Welcome to the Translator43.1 Update Patch")
  33.              ("\n\nThis Patch can only be applied to a existing.")
  34.              ("\ninstalled version of Translator42.4 in your LIBS:")
  35.              ("\ndirectory.  This script will abort if you don't")
  36.              ("\nhave the required Library.  Your existing file")
  37.              ("\nwill be renamed 'translator42.4xlibrary and the")
  38.              ("\nselected patch will be applied to create a new")
  39.              ("\ntranslator.library.  Also a minor change will be")
  40.              ("\nmade to the Italiano.accent, if you have it")
  41.              ("\ninstalled, for compatibility with Translator43.")
  42.              ("\n\nAre you ready to proceed?")
  43.         )
  44.     )
  45.   )
  46. )
  47. (
  48. if  (AND (= ver 43) (> rev 0))
  49.   (
  50.   abort "Translator Library, Version 43.1 or greater,\n Appears to be Installed in your System;\n\n This Patch is not Applicable!"
  51.   )
  52. )
  53. (
  54. if (= ver 0)
  55.   ( 
  56.   message ("You do not have ANY translator.library\n installed in your system!\n\nTranslator42, version 42.4\n MUST be installed first.")
  57.   )
  58.   (
  59.   if  (AND (NOT (AND (= ver 42) (= rev 4)))  (NOT (AND (= ver 43) (= rev 0))))
  60.     (
  61.     message (cat ("You have version %ld.%ld of the translator.library installed" ver rev)
  62.                  ("\n\nTranslator version 42.4 or 43.0\n MUST be installed first.")
  63.             )
  64. ) ) )
  65.  
  66. (
  67. if  (AND (= ver 43) (= rev 0))
  68.   ( (
  69.     set filesize (getsize target)
  70.     )
  71.     (
  72.     if (= filesize 14384) 
  73.       ( (
  74.         working   "patching OS 2.x version of Translator 43.0"
  75.         )
  76.         (
  77.         rename target newtarget2
  78.         )
  79.         (
  80.         run spatch ("-o%s \"-p%s\" \"%s\"" target (tackon path "v37_translator1.pch") newtarget2)
  81.     ) ) )
  82.     (
  83.     if (= filesize 14244) 
  84.       ( (
  85.         working   "patching OS 1.3 version of Translator 43.0"
  86.         )
  87.         (
  88.         rename target newtarget2
  89.         )
  90.         (
  91.         run spatch ("-o%s \"-p%s\" \"%s\"" target (tackon path "v33_translator1.pch") newtarget2)
  92.     ) ) )
  93.     (
  94.     if (= filesize 14508) 
  95.       ( (
  96.         working   "patching 020 version of Translator 43.0"
  97.         )
  98.         (
  99.         rename target newtarget2
  100.         )
  101.         (
  102.         run spatch ("-o%s \"-p%s\" \"%s\"" target (tackon path "020_translator1.pch") newtarget2)
  103.     ) ) )
  104.     (set nvernum (getversion target))
  105.     (set newver (/ nvernum 65536))
  106.     (set newrev (- nvernum (* newver 65536)))
  107.     (
  108.     if (AND (= newver 43) (= newrev 1))
  109.       (
  110.         (message (cat ("Translator43.1 Installation Complete!\n\n")
  111.                       ("The new translator.library is in your\n")
  112.                       ("LIBS: directory.\n\nThe Log File will be in:\n")
  113.                       (@default-dest)
  114.                       ("\nif you elected to have one.")
  115.                    ))
  116.        (exit (quiet))
  117. ) ) ) )
  118.  
  119. (
  120. if  (AND (= ver 42) (= rev 4))
  121.   ( (
  122.     set filesize (getsize target)
  123.     )
  124.     (
  125.     if (= filesize 12480) 
  126.       ( (
  127.         working   "patching OS 2.x version of Translator 42"
  128.         )
  129.         (
  130.         rename target newtarget1
  131.         )
  132.         (
  133.         run spatch ("-o%s \"-p%s\" \"%s\"" target (tackon path "v37_translator.pch") newtarget1)
  134.     ) ) )
  135.     (
  136.     if (= filesize 12356) 
  137.       ( (
  138.         working   "patching OS 1.3 version of Translator 42"
  139.         )
  140.         (
  141.         rename target newtarget1
  142.         )
  143.         (
  144.         run spatch ("-o%s \"-p%s\" \"%s\"" target (tackon path "v33_translator.pch") newtarget1)
  145.     ) ) )
  146.     (
  147.     if (= filesize 12596) 
  148.       ( (
  149.         working   "patching 020 version of Translator 42"
  150.         )
  151.         (
  152.         rename target newtarget1
  153.         )
  154.         (
  155.         run spatch ("-o%s \"-p%s\" \"%s\"" target (tackon path "020_translator.pch") newtarget1)
  156.     ) ) )
  157.     (set nvernum (getversion target))
  158.     (set newver (/ nvernum 65536))
  159.     (set newrev (- nvernum (* newver 65536)))
  160.     (
  161.     if (AND (= newver 43) (= newrev 1))
  162.       ( (
  163.         set filesize (getsize acctarg)
  164.         )
  165.         (
  166.         if (= filesize 1378) 
  167.           (
  168.           (message (cat ("Translator43.1 Installation Complete!\n\n")
  169.                         ("The new translator.library is in your\n")
  170.                         ("LIBS: directory.\n\nThe Log File will be in:\n")
  171.                         (@default-dest)
  172.                         ("\nif you elected to have one.")
  173.                    ))
  174.           (exit (quiet))
  175.         ) )
  176.         (
  177.         if (= filesize 1331)
  178.           ( (
  179.             working   "patching Italiano.accent"
  180.             )
  181.             (
  182.             rename acctarg newacctarg
  183.             )
  184.             (
  185.             run spatch ("-o%s \"-p%s\" \"%s\"" acctarg (tackon path "Italiano.pch") newacctarg)
  186.             )
  187.             (
  188.             (message (cat ("Translator43.1 Installation Complete!\n\n")
  189.                           ("The new translator.library is in your\n")
  190.                           ("LIBS: directory.\n\nThe Log File will be in:\n")
  191.                           (@default-dest)
  192.                           ("\nif you elected to have one.")
  193.                      ))
  194.             (exit (quiet))
  195.           ) )
  196.           (
  197.           abort "Translator43 Installed; \nItaliano.accent not found or fixed"
  198.         ) )
  199.         (
  200.         abort "Installation Failed"
  201.   ) ) ) )
  202.   (
  203.     abort "Unable to Proceed\n" "translator.library 42.4\n is required for this patch."
  204.     )
  205.     (
  206.     abort "Invalid Setup for Patch"
  207.   ) )
  208.   
  209.